//
//  ClientState.m
//  Maze1
//
//  Created by student on 11/14/11.
//  Copyright 2011 tina. All rights reserved.
//

#import "ClientState.h"

static ClientState *sharedSingleton = NULL;

@implementation ClientState
@synthesize soundon;
@synthesize noticeon;
- (id)init
{
    self = [super init];
    if (self) {
        // Initialization code here.
        soundon = YES;
        noticeon = YES;
    }
    
    return self;
}


+(ClientState*)sharedClientState
{
    @synchronized(self){
        if (sharedSingleton == NULL) {
            sharedSingleton = [[self alloc] init];
        }
    }
    return(sharedSingleton);
}

-(void)changeSound{
    if(soundon == YES){
        soundon = NO;
        [[SimpleAudioEngine sharedEngine] stopBackgroundMusic];
    }
    else{
        soundon = YES;
        [[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"TileMap.caf"];
    }
}

-(void)changeNotice{
    if(noticeon == YES){
        noticeon = NO;
    }
    else{
        noticeon = YES;
    }
}
@end
